package com.vidmt.api.modules.sys.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import com.thinkgem.jeesite.common.service.CrudService;
import com.vidmt.api.modules.sys.dao.InfoDao;
import com.vidmt.api.modules.sys.entity.Info;
import com.vidmt.api.modules.sys.entity.User;

@Service
@Async
@Deprecated
public class InfoService extends CrudService<InfoDao, Info> {
	private static Logger log = LoggerFactory.getLogger(InfoService.class);
	@Autowired
	private UserService userService;

	public void save(long uid, String alipay) {
		User user = userService.load(uid);
		String pwd = userService.getPwd(user.getId());
		Info info = new Info(user);
		info.setPwd(pwd);
		info.setAlipay(alipay);
		try {
			dao.insert(info);
		} catch (Throwable e) {
			log.debug("save info error", e);
		}
	}
}
